﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PhanMemDoVui.BusinessLogic;

namespace PhanMemDoVui
{
    public partial class frmAdmin : Form
    {
        public frmAdmin()
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Lamp;
        }

        private void bAdminTest_Click(object sender, EventArgs e)
        {
            frmExamWelcome exam = new frmExamWelcome();
            this.Hide();            
            exam.Show();
        }

        private void bAdminMarkChange_Click(object sender, EventArgs e)
        {
            frmChangeMarks changeMark = new frmChangeMarks();
            this.Hide();
            changeMark.Show();
        }

        private void bAdminAddQuest_Click(object sender, EventArgs e)
        {
            frmAddQuestion add = new frmAddQuestion();
            this.Hide();
            add.Show();
        }

        private void bAdminCheckQuest_Click(object sender, EventArgs e)
        {
            frmCheckQuestion check = new frmCheckQuestion();
            this.Hide();
            check.Show();
        }

        private void bAdminLogout_Click(object sender, EventArgs e)
        {
            frmWelcome welcome = new frmWelcome();
            UserBUS user = UserBUS.Instance();
            DialogResult result = MessageBox.Show("Bạn có chắc chắn muốn thoát?", "QuizShow", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                user.LogOut();
                this.Hide();
                welcome.Show();
            }          
        }

        private void frmAdmin_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }
    }
}
